package com.shelpe.services.scheduler.item.adgroup;


import org.springframework.batch.item.ItemProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.shelpe.services.scheduler.po.Adgroups;
import com.shelpe.services.scheduler.po.Campaigns;
import com.shelpe.services.scheduler.syncclient.AdgroupClient;

@Component("adgroupProcessor")
public class AdgroupProcessorImpl implements ItemProcessor<Campaigns, Adgroups>{

	@Autowired
	private AdgroupClient adClient;
	
	@Override
	public Adgroups process(Campaigns item) throws Exception {
		// TODO Auto-generated method stub
		
		long userId = item.getUserId();
		long campaignId = item.getCampaignId();			
		adClient.syncAdgroupsByUserId(userId, campaignId);
		
		return null;
	}
}
